<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model app\modules\Product\models\Template */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Templates'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="template-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'cruise.name',
            [
                'attribute' => 'from_city',
                'value' => isset(Yii::$app->params['city'][$model->from_city]) ? Yii::$app->params['city'][$model->from_city] : '(未设置)',
            ],
            [
                'attribute' => 'to_city',
                'value' => isset(Yii::$app->params['city'][$model->to_city]) ? Yii::$app->params['city'][$model->to_city] : '(未设置)',
            ],
            [
                'attribute' => 'go_city',
                'value' => isset(Yii::$app->params['city'][$model->go_city]) ? Yii::$app->params['city'][$model->go_city] : '(未设置)',
            ],
            [
                'attribute' => 'return_city',
                'value' => isset(Yii::$app->params['city'][$model->return_city]) ? Yii::$app->params['city'][$model->return_city] : '(未设置)',
            ],
            'name',
            [
                'attribute' => 'line',
                'value' => isset(Yii::$app->params['line'][$model->line]) ? Yii::$app->params['line'][$model->line] : '(未设置)',
            ],
            'cost:html',
            'visa:html',
            [
                'attribute' => 'trip',
                'value' =>$model->tripstyle,
                'format' => 'html',
            ],
            [
                'attribute' => 'status',
                'value' => Yii::$app->params['status'][$model->status],
            ],
            'created_at:relativeTime',
        ],
    ]) ?>

</div>
